<?php
/**
 * Desc:
 * User: yangyang
 * Date: 2024/4/8 15:33
 * Ver: 1.0
 */

namespace App\Transformers;

use App\Models\Category;
use League\Fractal\TransformerAbstract;

class CategoryTransformer extends TransformerAbstract
{

    public function transform(Category $category)
    {
        return [
            'id'   => $category->id,
            'name' => $category->name,
        ];
    }

}
